//package com.lq.order.config;
//
//import org.springframework.amqp.core.*;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class RabbitConfig {
//
//    // 订单交换机
//    public static final String ORDER_EXCHANGE = "order.exchange";
//
//    // 订单队列
//    public static final String ORDER_QUEUE = "order.queue";
//
//    // 路由键
//    public static final String ORDER_ROUTING_KEY = "order.create";
//
//    @Bean
//    public Exchange orderExchange() {
//        return ExchangeBuilder.directExchange(ORDER_EXCHANGE).durable(true).build();
//    }
//
//    @Bean
//    public Queue orderQueue() {
//        return QueueBuilder.durable(ORDER_QUEUE).build();
//    }
//
//    @Bean
//    public Binding orderBinding() {
//        return BindingBuilder.bind(orderQueue()).to(orderExchange()).with(ORDER_ROUTING_KEY).noargs();
//    }
//}